home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / bronzeclip.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-27  |  3KB  |  121 lines

  1. /* BronzeClip.rexx V2.0 -- Colorize a clip.          */
  2. /* By Bob Caron © 1995 NewTek Inc.                   */
  3.  
  4. parse arg InClipName","OutClipName","StartField","EndField
  5.  
  6. Address "DigiPaint"
  7. options results
  8.  
  9. IFFBaseName=OutClipName
  10.  
  11. if ~show('l','rexxsupport.library') then do
  12.   if ~addlib('rexxsupport.library',0,-30,34) then do
  13.     exit
  14.   end
  15. end
  16.  
  17. screen=0
  18. if inclipname="" then screen=1
  19. if screen=1 then do
  20.    startfield=1
  21.    endfield=1
  22.    end
  23.  
  24. /* Reset Paint */
  25. 'Pmcl'
  26. 'Pot0' 0
  27. 'Pot1' 0
  28. 'Poth' $8000
  29. 'Potv' $8000
  30. 'Spoh' $8000
  31. 'Spov'
  32. /* End Of Reset*/
  33.  
  34. PageWide=752
  35. PageHigh=480
  36. dots=0
  37. XWin = 100
  38. YWin = 40
  39. Clear = d2c(12)
  40. nv = ''
  41. cr = '0a'x
  42. call getfontsize
  43.  
  44. wid = width*48
  45. hei = theight+height*10
  46.  
  47. if screen=0 then do
  48.    if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/BronzeClip Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  49.        exit
  50.    end
  51. end
  52.  
  53. do Frame = StartField to (StartField+(EndField-StartField)/2)
  54.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  55.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  56.   call filter()                    /* Do The filter Thing...                 */
  57.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  58.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  59.   if screen=0 then call filter()   /* If this is a flyer clip do other field */
  60.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  61.   if screen=1 then 'Shco'          /* Render To Buffer (if this is screen processing)*/
  62.   end
  63. if screen=0 then 'Iclp'            /* Add an flyer icon to this clip */
  64. exit
  65.  
  66. filter:  /* Do a filter */
  67.  
  68. '8rgb' 128 64 0 /* Slightly Bronzeish */
  69. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  70. 'Pmco'          /* colorize Mode */
  71. 'Mane'          /* Set Edge transparency to 0% */
  72. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  73. 'Whsc'          /* Fill Whole Screen */
  74.  
  75. return
  76.  
  77.  
  78. OpenWindow:
  79. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  80.   pdots="...."
  81.   dots=dots+1
  82.   if dots>4 then dots=1
  83.   call writech('Window',Clear||nv||cr)
  84.   call writech('Window','Current Source Clip ['InClipName']'cr)
  85.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  86.   call writech('Window',''cr)
  87.   call writech('Window','Current Frame: 'Frame/2''cr)
  88.   call writech('Window','    End Frame:'EndFrame/2''cr)
  89.   call writech('Window',''cr)
  90.   call writech('Window','Processing'right(pdots,dots)||cr)
  91.  
  92. return
  93.  
  94.  
  95. getfontsize:
  96.  
  97. if open('font','env:sys/font.prefs','R') then do
  98.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  99.    call close('font')
  100.    font = substr(font,index(font,'FONT')+4)
  101.    font = substr(font,index(font,'FONT')+4)
  102.    height = c2d(substr(font,29,2))
  103.    tfont = substr(font,index(font,'FONT')+4)
  104.    theight = c2d(substr(tfont,29,2))
  105.    font = substr(font,33)
  106.    font = left(font,index(font,d2c(0))-1-5)
  107.    if open('font','FONTS:'font'/'height,'R') then do
  108.       width = c2d(right(readch('font',116),2))
  109.       call close('font')
  110.   end
  111.   else if height=9 then width = 10
  112.                    else width = 8
  113. end
  114.   else do
  115.   theight = 8
  116.   height = 8
  117.   width = 8
  118. end
  119.  
  120. return
  121.